@model T2.Logging.ASPMVC.ViewModel.LogViewModel
@using T2.Logging.ASPMVC.Entity.Interface        
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>Customer Search</title>
</head>
<body>
    <script type="text/javascript">
        jQuery(document).ready(function () {
            jQuery("#logslist").jqGrid({
            url: '' ,
            datatype: 'local',
            mtype: 'POST',
			colNames: ['', '', 'Title', 'Machine Name', 'App Domain Name', 'Message'],
            colModel: [
           { name: 'imgUdt', sortable:false, index: 'imgUdt', width: 20, editable: false, align: 'center' },
           { name: 'imgNew', sortable:false, index: 'imgNew', width: 20, editable: false, align: 'center' },
		   { name: 'Title', index: 'Title', width: 200, editable: false, align: 'left', color: 'red', searchoptions: { sopt: ['eq', 'ne', 'cn']}},
			{ name: 'MachineName', index: 'MachineName', width: 200, editable: false, align: 'left', color: 'red', searchoptions: { sopt: ['eq', 'ne', 'cn']}},
			{ name: 'AppDomainName', index: 'AppDomainName', width: 200, editable: false, align: 'left', color: 'red', searchoptions: { sopt: ['eq', 'ne', 'cn']}},
			{ name: 'Message', index: 'Message', width: 200, editable: false, align: 'center', color: 'red', searchoptions: { sopt: ['eq', 'ne', 'cn']}}],
            pager: jQuery('#pager'),
            rowNum: 20,
            rowList: [5, 10, 20, 50],
            sortname: 'LogID',
            sortorder: "desc",
            multiselect: false,
            shrinktofit: true,
            height: 250,
            width: 750,
            viewrecords: true,
            caption: 'Log Search',
			loadError: function (xhr, textStatus, errorThrown) {
                       var error_msg = xhr.responseText
                       var msg = "Some errors occurred during processing:"
                       msg += '\n\n' + error_msg
                       $('#dialog').html(msg);
                       $('#dialog').dialog({ title: "Error" });
                   },
			onCellSelect: function(rowid, iCol, cellcontent) {
	                // Click in cell.
	                if (iCol == 0) {
					
						
	                }
					if (iCol == 1) {
					
	                }
	                return true;

	            },

            onSelectRow: function(ids) {
				LogID = ids ;
               return true;
            }

        });



            jQuery("#logslist").jqGrid('navGrid', '#pager',
            {
                edit: false, add: false, del: false, search: true, refresh: true
            }

            );


            $('#trgSearch').click(function (event) {

var myUrl ="./Log/Search?Title=" + $("#Title").val() +  "&MachineName=" + $("#MachineName").val() +  "&AppDomainName=" + $("#AppDomainName").val() +  "&Message=" + $("#Message").val();
                
                $("#logslist").setGridParam({ datatype: 'json', url: myUrl }).trigger("reloadGrid");
            });

        }); 
    </script>

    
    Title: <input type="text" name="Title" id="Title" />
Machine Name: <input type="text" name="MachineName" id="MachineName" />
App Domain Name: <input type="text" name="AppDomainName" id="AppDomainName" />
Message: <input type="text" name="Message" id="Message" />


        
        <input type="button" value="Search" id="trgSearch" />
		<table id="logslist" class="scroll" cellpadding="0" cellspacing="0" ></table>
        <div id="pager" class="scroll" style="text-align:center;"></div>
</body>
</html>

